<@_metadata path='/index.html'><#assign metadata=object/></@_metadata>
<header>
	<div class="container">
		<div class="tools">
			<div class="user user-login">
				<a href="${metadata.extendData.member!}login.html">登陆</a>
				<a href="${metadata.extendData.member!}register.html">注册</a>
			</div>
			<div class="user user-logout" style="display:none">
				您好，<a href="${metadata.extendData.member!}" target="_blank" class="nickname"></a> <a class="master" style="display:none;" target="_blank" href="${site.dynamicPath}admin/">管理后台</a> <a class="logout" href="${metadata.extendData.member!}logout.do">退出登陆</a>
			</div>
			<form class="search" action="${metadata.extendData.search!}">
				<input name="word" type="text" placeholder="这里输入关键词"/>
				<input type="submit" value="搜索"/>
			</form>
			<div class="clearfix-before"></div>
		</div>
		<a href="#" class="nav-icon"></a>
		<div class="logo">
			<a href="${site.sitePath}"><img src="${site.resourcePath!}image/logo.png" alt="Public CMS"/></a>
		</div>
		<span class="slogan"><@_metadata path='/index.html'>${object.extendData.slogan!}</@_metadata></span>
		<nav class="clearfix-before">
			<ul>
				<li><a href="${site.sitePath}">首页</a></li>
<@_categoryList>
	<#list page.list as a>
				<li>
					<a href="${a.url!}">${a.name}</a>
		<#if a.childIds?has_content>
					<ul>
			<@_categoryList parentId=a.id>
				<#list page.list as a>
						<li><a href="${a.url!}">${a.name}</a></li>
				</#list>
			</@_categoryList>
					</ul>
		</#if>
				</li>
	</#list>
</@_categoryList>
				<@_includePlace path="/index.html/750c5b01-3e58-43ab-b1c1-f9cfc8b4f5f8.html"/> <#-- 导航-下载链接 -->
				<@_includePlace path="/index.html/5cf1b463-8d14-4ba4-a904-890ec224dc99.html"/> <#-- 导航-动态站点 -->
			</ul>
		</nav>
		<div class="clearfix-before"></div>
	</div>
</header>
<script>
	$('.nav-icon').click(function(){$('header nav>ul').fadeToggle();return false;});
	$(function(){
		var headerHeight=$('header').height();
		$(window).resize(function(){
			$('header nav>ul').removeAttr('style');
		});
		$(window).scroll(function(){
			if(headerHeight-$(window).scrollTop()>0){
				$('header').removeClass('fixed-position');
			} else {
				$('header').addClass('fixed-position');
			}
		});
		if ($.cookie("CMS_USER")) {
			var userdata = $.cookie('CMS_USER').split('##');
			if(userdata.length > 2) {
				$('.tools .user').hide();
				$('.tools .user-logout .nickname').text(userdata[1]);
				$('.tools .user-logout').show();
				if(userdata[2]&&'true'==userdata[2]){
					$('.tools .user-logout .master').show();
				}
				$('.tools .user-logout .logout').prop('href',$('.tools .user-logout .logout').prop('href')+'?returnUrl='+encodeURIComponent('${metadata.extendData.member!}login.html?returnUrl='+encodeURIComponent(window.location.href)));
			}
		}
		if(0>window.location.href.indexOf('returnUrl')){
			$('.tools .user-login a').each(function(){
				$(this).prop('href',$(this).prop('href')+'?returnUrl='+encodeURIComponent(window.location.href));
			});
		}		
	});
</script>